﻿/// <Reference Name="MicrosoftAjax.js" />

function pageLoad(sender, args) {
    // Page load logic here


    // Add add new ticket event
    Sys.UI.DomEvent.addHandler($get('addNewTicket'), 'click', function (evt) {
        var dlg = SP.UI.ModalDialog.showModalDialog({
            title: "Add new ticket",
            url: 'AddNewTicket.aspx',
            dialogReturnValueCallback: function (result) {
                if (result === SP.UI.DialogResult.OK) {
                    __doPostBack('ctl00$PlaceHolderMain$NewTicketsView', '__refresh');
                }
            }
        });
    });


}